package com.durian.base.net.request;

import com.durian.base.net.Utils;
import okhttp3.Request;

/**
 * 说明：OkSyncGet
 * <p/>
 * 作者：fanly
 * <p/>
 * 类型：Class
 * <p/>
 * 时间：2019/2/18 17:00
 * <p/>
 * 版本：version 1.0
 */
public class OkSyncGet extends OkSyncHttpTask {

    public OkSyncGet(String url) {
        super(url);
    }

    public static OkSyncGet create(String url){
        return new OkSyncGet(url);
    }

    @Override
    public Request.Builder createRequestBuilder() {
        return new Request.Builder()
                .tag(getUrl())
                .headers(getRequestParams().getHeaders())
                .get()
                .url(Utils.getFullUrl(getUrl(), getRequestParams().getParams(), getRequestParams().isUrlEncoder()));
    }

}
